//
//  XHDemoViewController.m
//  XHFoundationModule
//
//  Created by xinph on 2020/3/13.
//  Copyright © 2020 xinph. All rights reserved.
//

#import "XHDemoViewController.h"
#import "DemoWebViewModel.h"
#import "DemoWebViewController.h"

@interface XHDemoViewController ()

@property (nonatomic, strong, readwrite) XHDemoViewModel  *viewModel;

@end

@implementation XHDemoViewController
@synthesize viewModel = _viewModel;

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath withObject:(id)object
{
    cell.textLabel.text = [NSString stringWithFormat:@"----%zd", indexPath.row];
    
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://gitee.com/x_ph"]];
    DemoWebViewModel *webModel = [[DemoWebViewModel alloc] initWithServices:nil params:@{XHViewModelRequestKey: request}];
    DemoWebViewController *webVC = [[DemoWebViewController alloc] initWithViewModel:webModel];
    [self.navigationController pushViewController:webVC animated:true];
}

@end
